package app;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Test {

    public static void main(String[] args) {

	Date start = new Date(2011, 1, 10);
	Date end = new Date(2011, 2, 10);
	System.out.println(getDays(start, end));

    }

    static long getDays(Date start, Date end) {
	Calendar calendar = GregorianCalendar.getInstance();
	calendar.setTime(start);
	// calendar.set(Calendar.HOUR_OF_DAY, 0);
	// calendar.set(Calendar.MINUTE, 0);
	// calendar.set(Calendar.SECOND, 0);
	// calendar.set(Calendar.MILLISECOND, 0);

	long l = calendar.getTimeInMillis();

	calendar.setTime(end);
	// calendar.set(Calendar.HOUR_OF_DAY, 0);
	// calendar.set(Calendar.MINUTE, 0);
	// calendar.set(Calendar.SECOND, 0);
	// calendar.set(Calendar.MILLISECOND, 0);

	l = calendar.getTimeInMillis() - l;
	return l / (24 * 60 * 60 * 1000);

    }

}